/*
 Copyright 2009 Abdulla Abdurakhmanov (abdulla@latestbit.com)
 Original sources are available at www.latestbit.com

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 IServerSkeleton.hpp. Created on: 14.10.2009 15:16:30 
 */

#ifndef ISERVERSKELETON_HPP_
#define ISERVERSKELETON_HPP_

#include "smartobjects/SmartObjectsDefs.hpp"
#include "smartobjects/ISmartObject.hpp"
#include "smartobjects/core/LifecycleControlParams.hpp"

namespace smartobjects {

class IServerSkeleton : public virtual ISmartObject {
public:
	enum ThreadModel {
		SINGLE_THREAD_MODEL,
		PER_CLIENT_MULTI_THREAD_MODEL,
		FULL_MULTI_THREAD_MODEL
	};

public:
	SO_DLLPRFX virtual ~IServerSkeleton();

	virtual const char** getSupportedInterfaces() const = 0;

	virtual void publish( ISmartBus* poBus, IEndpointLocation* poLocation) = 0;

	virtual void publish( ISmartObject* poBaseObject ) = 0;
	virtual void publish( ISmartObject* poBaseObject, ConnectionHandler* poConnectionHandler ) =0;
	virtual void unpublish() = 0;

	virtual void registerInstance ( ConnectionHandler* poConnectionHandler ) = 0;
	virtual void unregisterInstance () = 0;

	virtual LifecycleControlParams& getLifecycleControlParams() = 0;

	virtual bool isPublished() const = 0;
	virtual IEndpointLocation* getPublishedLocation() = 0;

	virtual void setThreadModel(ThreadModel nModel) = 0;
	virtual ThreadModel getThreadModel() = 0;

	virtual size_t getRequestQueueSize() const = 0;
};

}

#endif /* ISERVERSKELETON_HPP_ */
